package com.easyidea.its.util;

import javax.servlet.http.HttpSession;

import com.opensymphony.webwork.ServletActionContext;

public final class SessionUtil {

	private SessionUtil() {
	}

	/**
	 * get current session instance
	 * 
	 * @return
	 */
	public static HttpSession getSession() {
		return ServletActionContext.getRequest().getSession();
	}

	/**
	 * 
	 * @return
	 */
	public static Object getSessionValue(String name) {
		HttpSession session = ServletActionContext.getRequest().getSession();
		return session.getAttribute(name);
	}

	/**
	 * 
	 * @param name
	 * @param obj
	 */
	public static void setSessionValue(String name, Object obj) {
		HttpSession session = ServletActionContext.getRequest().getSession();
		session.setAttribute(name, obj);
	}

}
